KISSY.use("node",function(S,Node){ 
$(".bui-tab-item").on("click",function(){
		$(".bui-tab-item").removeClass("bui-tab-item-selected");
		$(this).addClass("bui-tab-item-selected");
		var tp = $(this).attr("data-tp");
		$(".xinde,.pics,.items").addClass("hide");
		$("."+tp).removeClass("hide");
		$(".tags").removeClass("badge-info");
		$(".tag").val('');
		var type = $(".type").val();
		if(tp=='xinde'){
			location.href=("/?a=list&m=shop&c=content&ctp=xinde"+(type?"&type="+type:""));
		}else if(tp=='items'){
			location.href=("/?a=list&m=shop&c=content&ctp=items"+(type?"&type="+type:""));
		}else if(tp=='pics'){
			location.href=("/?a=list&m=shop&c=content&ctp=pics"+(type?"&type="+type:""));
		}
	});
$(".add").on("click",function(){
	var ctp =$(this).attr("data-ctp");
	location.href=("/?a=add&m=shop&c=content&ctp="+(ctp?ctp:"content"));
});
$(".trash").on("click",function(){
	var ctp =$(this).attr("data-ctp");
	location.href=("/?a=list&m=shop&c=content&ctp="+(ctp?ctp:"content")+"&type=9");
});
$(".list").on("click",function(){
	var ctp =$(this).attr("data-ctp");
	location.href=("/?a=list&m=shop&c=content&ctp="+(ctp?ctp:"content"));
});
$('.icon-remove').on("click",function(){
	var ctp =$(this).attr("data-ctp");
	var id =$(this).attr("data-id");
	var del = $(this).attr("data-del");
	KISSY.io({
			url: "/?a=remove&m=shop&c=content",
			data: {"ctp":ctp,"id":id,"del":del},
			success: function(data, textStatus) {
				if(data.status==false){
					alert("失败");
				}else{
					$(".re"+ctp+id).addClass("hide");
					// var an = KISSY.anim(".re"+ctp+id,{background-color:"#000"},1,"easeOut");
					// an.run();
					//alert("成功");
				}
			},
			complete: function(data){
			},
			error: function(){
				alert('error');
			},
			dataType:"jsonp"
	});
});
$(".tags").on("click",function(){
	$(".tags").removeClass("badge-info");
	$(this).addClass("badge-info");
	$(".tag").val($(this).attr("data-tagname"));
});
$(".js-checkmsg").on("click",function(){
	var contentid = $(this).attr("data-id");
		KISSY.io({
			url: "/?a=getmsg&m=shop&c=content",
			data: {"contentid":contentid},
			success: function(data, textStatus) {
				if(data.status==false){
					alert("失败");
				}else{
					showDialog("消息",data.message,"row");
				}
			},
			complete: function(data){
			},
			error: function(){
				alert('error');
			},
			dataType:"jsonp"
	});
});
});